package main

import "crypto/sha256"

func countUnSameByte(s1, s2 []byte) int {
	c1 := sha256.Sum256(s1)
	c2 := sha256.Sum256(s2)

	unSameCount := 0
	for i := 0; i < len(c1); i++ {
		//1个字节8个bit,移位运算，获取每个bit
		for m := 0; m <= 8; m++ {
			// 获取某一位的值
			bit1 := (c1[i] >> uint(m)) & 1
			bit2 := (c2[i] >> uint(m)) & 1
			if bit1 != bit2 {
				unSameCount++
			}
		}
	}
	return unSameCount
}
